package com.example.consumerdemo.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author kw
 * @program cloud-alibaba-demo
 * @description 基础服务配置
 * @create 2024 - 06 - 28 09:29
 **/
@Configuration
public class ServiceBaseConfig {

    /**
     * RestTemplate
     * LoadBalanced ：负载均衡
     *
     * @return
     */
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
